<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
	<meta charset="utf-8" />
	<title>{$Think.config.WEB_SITE_TITLE} | EasyWeb Admin Dashboard</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<meta name="MobileOptimized" content="320">
	<!-- BEGIN GLOBAL MANDATORY STYLES -->          
	<link href="__PUBLIC__/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="__PUBLIC__/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="__PUBLIC__/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<link href="__PUBLIC__/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
	<link href="__PUBLIC__/assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="__PUBLIC__/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="__PUBLIC__/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
	<link href="__PUBLIC__/assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
	<link href="__PUBLIC__/assets/css/pages/login.css" rel="stylesheet" type="text/css"/>
	<link href="__PUBLIC__/assets/css/custom.css" rel="stylesheet" type="text/css"/>
	<!-- END THEME STYLES -->
	<link rel="shortcut icon" href="favicon.ico" />
	<style type="text/css">
	body{
		font: 14px/1.5 "microsoft yahei", Helvetica, Tahoma, Arial, sans-serif;
	}
	</style>
</head>
<!-- BEGIN BODY -->
<body class="login">
	<!-- BEGIN LOGO -->
	<div class="logo">
		<img src="__PUBLIC__/assets/img/logo-big.png" alt="" /> 
	</div>
	<!-- END LOGO -->
	<!-- BEGIN LOGIN -->
	<div class="content">
		<!-- BEGIN LOGIN FORM -->
		<form class="login-form" action="{:U('Public/checkLogin')}" method="post">
			<h3 class="form-title">后台登陆</h3>
			<div class="form-group">
				<!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->
				<label class="control-label visible-ie8 visible-ie9">用户名</label>
				<div class="input-icon">
					<i class="icon-user"></i>
					<input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="用户名" name="username"/>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label visible-ie8 visible-ie9">密码</label>
				<div class="input-icon">
					<i class="icon-lock"></i>
					<input class="form-control placeholder-no-fix" type="password" autocomplete="off" placeholder="密码" name="password"/>
				</div>
			</div>
			<div class="form-actions">
				<label class="checkbox">
					<input type="checkbox" name="remember" value="1"/> 记住我
				</label>
				<button type="button" class="btn green pull-right ajax-post">
					登 陆 <i class="m-icon-swapright m-icon-white"></i>
				</button>            
			</div>
		</form>
		<!-- END LOGIN FORM -->        
	</div>
	<!-- END LOGIN -->
	<!-- BEGIN COPYRIGHT -->
	<div class="copyright">
		2014 &copy; EasyWeb Admin Dashboard.
	</div>
	<!-- END COPYRIGHT -->
	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->   
	<!--[if lt IE 9]>
	<script src="__PUBLIC__/assets/plugins/respond.min.js"></script>
	<script src="__PUBLIC__/assets/plugins/excanvas.min.js"></script> 
	<![endif]-->   
	<script src="__PUBLIC__/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
	<script src="__PUBLIC__/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
	<script src="__PUBLIC__/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="__PUBLIC__/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
	<script src="__PUBLIC__/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="__PUBLIC__/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<script src="__PUBLIC__/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>
	<!-- END CORE PLUGINS -->
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script src="__PUBLIC__/assets/plugins/jquery-validation/dist/jquery.validate.min.js" type="text/javascript"></script>	
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/assets/plugins/bootstrap-toastr/toastr.min.css" />
	<script type="text/javascript" src="__PUBLIC__/assets/scripts/jquery.form.js"></script> 
	<script type="text/javascript" src="__PUBLIC__/assets/plugins/bootstrap-toastr/toastr.min.js"></script> 
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="__PUBLIC__/assets/scripts/app.js" type="text/javascript"></script>
	<script src="__PUBLIC__/assets/scripts/login.js" type="text/javascript"></script> 
	<!-- END PAGE LEVEL SCRIPTS --> 
	<script>
	jQuery(document).ready(function() {     
		App.init();
	});

	$(function() {
		$("body").bind('keyup',function(event) {  
			if( event.keyCode == 13 ) {  
			    $('.login-form').ajaxSubmit(options);  
			}   
		});
	});
	
	toastr.options = {
		positionClass: 'toast-top-full-width',
		timeOut: '1500',
		onclick: null
	}; 

	var options = { 
		resetForm: false, 
		type:'post',
		dataType:  'json' ,
		success: function(data){
			if(data.status) {
				toastr['success'](data.info);
				if(data.url!=='') {
					setTimeout(function() {
						window.location.href = data.url;
					},1500);
				}else{
					setTimeout(function() {
						window.location.reload();
					},1500);
				}
			}else{
				toastr['error'](data.info);
			}
		},
		error: function(data){
			toastr['error'](data.info);
		}
	}; 
	$('.ajax-post').click(function() { 
		$(this).parents('form').ajaxSubmit(options); 
		$(this).attr('disabled', true);
		setTimeout(function() {
			$('.ajax-post').removeAttr('disabled');
		},1499)
		return false;
	}); 

	$('.del-get').click(function() {
		if(confirm('确定删除？')==false) {
			return false;
		}else{
			$.get(
				$(this).attr('href'),
				function(data) {
					if(data.status) {
						toastr['success'](data.info);
						setTimeout(function() {
							window.location.reload();
						},1500)
					}else{
						toastr['error'](data.info);
					}
				}
				)
		}
		return false;
	})
	</script>	
</body>
<!-- END BODY -->
</html>